The present invention relates to a method of correcting the tilt, or rotation, of an electronic image by cropping a rotated version of the original image in accordance with a predefined set of image composition rules. The present invention also relates to an image processing system employing this method and an image capture system incorporating such an image processing system.
When photographs are taken without due care by a photographer the camera may not be correctly orientated with respect to the horizontal. This results in a tilted, or rotated, image. The tilt can be corrected by rotating the electronic image by an angle equal to the angle to the horizontal that the camera was originally held at. However, the rotated image must typically be cropped to generate a final image rectangle with horizontal and vertical edges. A problem then arises of how best to select the position of this cropped image.
The above problem also applies to images recorded by a video camera, because moving images are being continuously recorded onto a recording medium, it is advantageous to correct the tilt of the camera before the moving images are stored.
Image handling systems have been proposed to address the problem of tilt.
EP 949802 discloses a scanner for scanning a document. The document may be presented in a document carrier, typically a transparent envelope, in order to protect it from damage by a feed mechanism incorporated within the scanner. The scanner automatically ignores components in the scanned image due to the document carrier or resulting from imaging parts of the scanner. The scanner seeks to identify the edges of the scanned document in order to determine the skew of the document with respect to the scanner. The de-skew process does not take account of the content of the document. Hence it cannot work if the image in a scanned photograph is skewed.
GB 2124055 relates to a photographic processing system. The system allows a user to set up a rough sketch pattern showing which portions of a plurality of input images are to be placed in an output image. The sketch needs to be determined prior to commencing a scan and write cycle as this information is used to control the position and speed of scan and write heads. Thus there is no automatic de-skewing of a picture.
GB 2350251 relates to a system for merging two or more images. One of the images is a pre-stored template having a hole therein for receiving a user generated image. The image is stored at two different resolutions, with the lower resolution image being used to display relative positioning of the two images, and the high resolution image being used to drive a printer. The system allows for the user generated image to be skewed automatically to match the general skew of a “frame” presented in the template. However the skewing is performed with respect to the edge of the user generated image. The skewing is not performed based on an analysis of the content of the image.
JP 6059430 discloses a “layout scanner” which seems to allow a user to define a trimming frame such that the user can instruct a design to be “cut out” and rotated.
Cameras containing tilt sensors to allow tilted images to be automatically corrected by electronic rotation are known. In some cases tilt sensors are applied to simply switch between recording of the image in a portrait orientation and recording the image in a landscape orientation. One example of such a system is that disclosed in U.S. Pat. No. 5,900,909. This patent discloses a method of detecting when a camera is held in a vertical “portrait” orientation and a system to automatically rotate the image such that the image is always recorded in the “landscape” horizontal position. This makes subsequent viewing of the images easier. A further example of this system is disclosed in the International application WO99/03264 that discloses a method of maintaining the aspect ratio of a captured image for both landscape and portrait images. Other, more advanced systems are also known, for example the video camera disclosed in U.S. Pat. No. 5,227,889 that employs a technique for correcting unintentional arbitrary tilt. However, a significant omission from the system disclosed in U.S. Pat. No. 5,227,889, and in other known systems, is the lack of any intelligent method for selecting where to position the crop rectangle in the rotated image. This disadvantage can most easily be understood by reference to FIGS. 1a-1d. 
FIG. 1a schematically represents an image recorded by a camera at a skewed angle. The arrow 2 shown with the image 1 represents a true vertical line and it can therefore be seen that the image 1 has been skewed by X degrees. FIG. 1b then shows the image 1 rotated by X degrees such that the arrow 2 is now vertically orientated. The rectangle 3 (shown in chain line) illustrates one possible crop boundary that could be applied to the rotated image 1 to produce a rectangular image having the correct orientation. FIG. 1c illustrates an alternative crop boundary 4 that may be applied to the rotated image 1. Both the crop boundary 3 shown in FIG. 1b and the crop boundary 4 shown in FIG. 1c represent the largest possible rectangular crop boundary that will fit within the rotated image 1. A typical prior art solution, and that applied in U.S. Pat. No. 5,227,889, is to ensure that the centre of the crop boundary is coincident with the centre of the original image. This is illustrated in FIG. 1d, where the centre of the original image is represented by the point 7, defined by the intersection of the two opposite diagonals 5′ and 5″ of the original image, and shows the largest crop boundary that will fit within the original tilted image having its centre, as defined by diagonals 6′ and 6″, coincident with that of the original image.
This choice, or any other arbitrary choice, may not produce the best possible re-composition of the image as the choice takes no account of the subject matter of the image. It would therefore be advantageous to produce a method of correcting the tilt of an image by generating a crop boundary that does take into account the subject matter of the image.